package com.rgh.pecunia.view;

import java.io.Serializable;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import com.rgh.pecunia.core.DataAccessObject;
import com.rgh.pecunia.core.dao.ObjectifyDAO;
import com.rgh.pecunia.domain.Account;

@RequestScoped
@ManagedBean
public class AccountQuery implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	List<Account> results;
	
	@PostConstruct
	public void query() {
		DataAccessObject dao = new ObjectifyDAO();
		results = dao.query(Account.class).list();
	}
	
	public List<Account> getResults() {
		return results;
	}
	
}
